<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
		<meta name="layout" content="main" />
        <link rel="stylesheet" href="${createLinkTo(dir:'css',file:'auction.css')}" />
		<title>Dodawanie aukcji</title>
        <gui:resources components="datePicker"/>
        <script type="text/javascript" src="${createLinkTo(dir:'js/tiny_mce',file:'tiny_mce.js')}"></script>
        <script type="text/javascript" src="${createLinkTo(dir:'js/tiny_mce',file:'auctions_config.js')}"></script>

	</head>
	<body>

		<div class="nav">
			<span class="menuButton"><g:link class="list" action="list">Lista aukcji</g:link></span>
		</div>

		<div class="body">
			<h1>Dodawanie aukcji</h1>
			<g:if test="${flash.message}">
			<div class="message">${flash.message}</div>
			</g:if>
			<g:hasErrors bean="${auction}">
			<div class="errors">
				<g:renderErrors bean="${auction}" as="list" />
			</div>
			</g:hasErrors>
			<g:form method="post" >
                <input type="hidden" name="id" value="${auction?.id}" />
				<div class="dialog">
                    <div id="tytul">
                        <p class="label"><label for="title">Tytuł:</label></p>
                        <input type="text" id="title" name="title" value="${auction?.title?.encodeAsHTML()}" size="100"/>
                        <p class="label"><label for="shortDesctiption">Podsumowanie:</label></p>
                        <input type="text" id="shortDescription" name="shortDescription" value="${auction?.shortDescription?.encodeAsHTML()}" size="100"/>
                        <p class="label"><label for="startingPrice">Cena wywoławcza:</label></p>
                        <input type="text" id="startingPrice" name="startingPrice" value="${auction?.startingPrice?.encodeAsHTML()}" size="4"/>
                    </div>
                    <div id="daty">
                        <div id="poczatek">
                            <p class="label"><label for="begin">Początek:</label></p>
                            <gui:datePicker id='begin'
                                name="begin"
                                value="${auction?.begin}"
                                formatString="yyyy-MM-dd"
                            />
                        </div>
                        <div id="koniec">
                            <p class="label"><label for="finish">Koniec:</label></p>
                            <gui:datePicker id='finish'
                                name="finish"
                                value="${auction?.finish}"
                                formatString="yyyy-MM-dd"
                            />
                        </div>
                    </div>
                    <p class="label"><label for="description">Opis:</label></p>
                    <textarea id='description' name="description">${auction?.description}</textarea>
				</div>

				<div class="buttons">
					<span class="button"><g:actionSubmit class="save" action="update" value="Aktualizuj" /></span>
                    <span class="button"><g:actionSubmit class="delete" action="delete" onclick="return confirm('Are you sure?');" value="Usuń" /></span>
				</div>

			</g:form>

		</div>
	</body>
</html>

